/**
 * @file ops_kernel_constants.h
 *
 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2019. All rights reserved.
 *
 * @brief constants
 *
 * @version 1.0
 *
 */

#ifndef FUSION_ENGINE_OPSKERNEL_OPS_KERNEL_STORE_OPS_KERNEL_CONSTANTS_H_
#define FUSION_ENGINE_OPSKERNEL_OPS_KERNEL_STORE_OPS_KERNEL_CONSTANTS_H_

#include <string>
#include "common/aicore_util_types.h"

namespace fe {
const int32_t COMPUTE_COST_DEFAULT = 10;

static const std::string STR_INT = "int";
static const std::string STR_FLOAT = "float";
static const std::string STR_BOOL = "bool";
static const std::string STR_STR = "str";
static const std::string STR_LIST_INT = "listInt";
static const std::string STR_LIST_FLOAT = "listFloat";
static const std::string STR_LIST_BOOL = "listBool";
static const std::string STR_LIST_STR = "listStr";
static const std::string STR_LIST_LIST_INT = "listListInt";

static const std::string STR_NAME = "name";
static const std::string STR_INPUT_LOWERCASE = "input";
static const std::string STR_OUTPUT_LOWERCASE = "output";
static const std::string STR_INPUT_FIRST_LETTER_UPPERCASE = "Input";
static const std::string STR_OUTPUT_FIRST_LETTER_UPPERCASE = "Output";
static const std::string STR_OP_FILE = "opFile";
static const std::string STR_OP_INTERFACE = "opInterface";
static const std::string STR_PRECISION_POLICY = "precision_reduce";
static const std::string STR_RESHAPE_TYPE = "reshapeType";
static const std::string STR_FLAG = "flag";
static const std::string STR_OP = "op";
static const std::string STR_PARAM_TYPE = "paramType";
static const std::string STR_CONST_VALUE_DEPEND = "valueDepend";
static const std::string STR_DTYPE = "dtype";
static const std::string STR_FORMAT = "format";
static const std::string STR_ALL = "all";
static const std::string STR_LIST = "list";
static const std::string STR_REQUIRED = "required";
static const std::string STR_ATTR = "attr";
static const std::string STR_ATTR_PREFIX = "attr_";
static const std::string STR_TYPE = "type";
static const std::string STR_VALUE = "value";
static const std::string STR_DEFAULT_VALUE = "defaultValue";
static const std::string STR_PATTERN = "pattern";
static const std::string STR_HEAVY_OP = "heavyOp";
static const std::string STR_SLICE_PATTERN = "slicePattern";
static const std::string STR_IMP_PATH = "imp_path";
static const std::string STR_PATH = "path";
static const std::string STR_NEED_CHECK_SUPPORT = "needCheckSupport";
static const std::string STR_DYNAMIC_FORMAT = "dynamicFormat";
static const std::string STR_DYNAMIC_SHAPE_SUPPORT = "dynamicShapeSupport";
static const std::string STR_DYNAMIC_RANK_SUPPORT = "dynamicRankSupport";
static const std::string STR_UNKNOWN_SHAPE_FORMAT = "unknownshape_format";
static const std::string STR_INPUT_MEM_CONTINUES = "inputMemContinues";
static const std::string STR_OUTPUT_MEM_CONTINUES = "outputMemContinues";
static const std::string STR_DYNAMIC_COMPILE_STATIC = "dynamicCompileStatic";

static const std::string STR_TRUE = "true";
static const std::string STR_FALSE = "false";
static const std::map<std::string, bool> STR_BOOL_MAP{{STR_TRUE, true}, {STR_FALSE, false}};

// maps utilized to transform string to enum
static const std::map<std::string, OpParamType> PARAM_TYPE_MAP{
        {"dynamic", DYNAMIC}, {"optional", OPTIONAL}, {"required", REQUIRED}, {"reserved", RESERVED}};

static const std::map<std::string, OpConstValueDepend> CONST_VALUE_DEPEND_MAP{
        {"required", CONST_REQUIRED}, {"optional", CONST_OPTIONAL}};

static const std::map<std::string, OpPattern> OP_PATTERN_MAP{{"formatAgnostic", OP_PATTERN_FORMAT_AGNOSTIC},
                                                      {"broadcast", OP_PATTERN_BROADCAST},
                                                      {"reduce", OP_PATTERN_REDUCE},
                                                      {"dynamic", OP_PATTERN_OP_CUSTOMIZE}};

static const std::map<std::string, SlicePattern> STR_SLICE_PATTERN_MAP{
        {"elemwise", ELEMENT_WISE},
        {"elemwiseBroadcast", ELEMENT_WISE_BROADCAST},
        {"broadcast", BROADCAST},
        {"slidingWindow", SLIDING_WINDOW},
        {"slidingWindowDeconv", SLIDING_WINDOW_DECONV},
        {"cubeMatmul", CUBE_MATMUL},
        {"reduce", SLICE_PATTERN_REDUCE},
        {"resize", SLICE_PATTERN_RESIZE},
        {"scatter", SLICE_PATTERN_SCATTER},
        {"segment", SLICE_PATTERN_SEGMENT},
};
}

#endif  // FUSION_ENGINE_OPSKERNEL_OPS_KERNEL_STORE_OPS_KERNEL_CONSTANTS_H_